<template>
  <form>
    <view class="cu-form-group">
    	<view class="title">背景音乐</view>
    	<switch class='red' @change="switchChangeBgMusic" :class="STATE.setting.IS_OPEN_BG_MUSIC?'checked':''" 
      :checked="STATE.setting.IS_OPEN_BG_MUSIC?true:false"></switch>
    </view>
    <view class="cu-form-group">
    	<view class="title">游戏音效</view>
    	<switch class='red' @change="switchChangeGameAudio" :class="STATE.setting.IS_OPEN_GAME_AUDIO?'checked':''" 
      :checked="STATE.setting.IS_OPEN_GAME_AUDIO?true:false"></switch>
    </view>
  </form>
</template>

<script>
export default {
  methods: {
    switchChangeBgMusic(e) {
      this.$store.commit("setting/TOGGLE_BG_MUSIC");
    },
    switchChangeGameAudio({ detail }) {
      this.$store.commit("setting/SET_GAME_AUDIO", detail.value);
    }
  }
};
</script>